import FingerprintJS from '@fingerprintjs/fingerprintjs'

// Initialize an agent at application startup.
const fpPromise = FingerprintJS.load();

export default function () {
  return new Promise(async (resolve, reject) => {
    const fp = await fpPromise
    const result = await fp.get()
    resolve(result.visitorId)
  })
}
